]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
lookingGlass: Use replaceAll()
authorAlessandro Bono <alessandro.bono369@gmail.com>
Fri, 20 Feb 2026 22:56:17 +0000 (23:56 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Sat, 14 Mar 2026 17:38:24 +0000 (18:38 +0100)
Remove all the newlines occurrences, not just the first one.

Fixes: 52ae75d4b ("LookingGlass - JavaScript prompt and interactive Clutter controller")
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/4084>
(cherry picked from commit 8ebf6ba2ca6000b99d6049ebbe2726c92af0e4e9)

js/ui/lookingGlass.js

index ef3eff12cac1b52151a03ba6051d09d1baf311c9..0161a7a478de259b75fd07f60f520201d56b3334 100644 (file)
@@ -1452,7 +1452,7 @@ class LookingGlass extends St.BoxLayout {
             let text = o.get_text();
             // Ensure we don't get newlines in the command; the history file is
             // newline-separated.
-            text = text.replace('\n', ' ');
+            text = text.replaceAll('\n', ' ');
             this._evaluate(text).catch(logError);
             return true;
         });